﻿using MyBlog.IService;
using MyBlog.Model;
using MyBlog.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyBlog.Service
{
    public class BlogNewsRepository: BaseRepository<BlogNews>, IBlogNewsRepository
    {
        public async override Task<List<BlogNews>> QueryAsync()
        {
            return await base.Context.Queryable<BlogNews>()
              .Mapper(c => c.TypeInfo, c => c.TypeId, c => c.TypeInfo.Id)
              .Mapper(c => c.WriterInfo, c => c.WriterId, c => c.WriterInfo.Id)
              .ToListAsync();
        }
    }
}
